package com.zr.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.TypeServer;
import com.zr.service.impl.TypeServerImpl;

import net.sf.json.JSONArray;

public class SelectAllTnameAction extends HttpServlet {

	TypeServer ts = new TypeServerImpl();
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setCharacterEncoding("utf8");
		req.setCharacterEncoding("utf8");
		PrintWriter pw = resp.getWriter();
		JSONArray json = ts.getAllTname();
		pw.write(json.toString());
	}
	
}
